package com.youlu.campus.admin.course.controller;

import com.youlu.campus.admin.course.dto.ActivityPopupDeleteDTO;
import com.youlu.campus.admin.course.dto.ActivityPopupSaveDTO;
import com.youlu.campus.admin.course.dto.ActivityPopupSearchDTO;
import com.youlu.campus.admin.course.service.ActivityPopupAdminService;
import com.yuelin.infrastructure.quantum.common.QResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : [dengbo]
 * @className : ActivityPopupController
 * @description : [小程序活动弹窗]
 * @createTime : [2022/11/29 11:36]
 */
@Slf4j
@RestController
public class ActivityPopupController {
    @Autowired
    private ActivityPopupAdminService activityPopupAdminService;

    /**
     * 小程序活动弹窗列表
     * @param request
     * @return
     */
    @PostMapping("/activity-popup/list")
    public QResult list(@Validated @RequestBody ActivityPopupSearchDTO request) {
        return QResult.success(activityPopupAdminService.list(request));
    }
    /**
     * 小程序活动弹窗保存
     * @param request
     * @return
     */
    @PostMapping("/activity-popup/save")
    public QResult list(@Validated @RequestBody ActivityPopupSaveDTO request) {
        return QResult.success(activityPopupAdminService.save(request));
    }
    /**
     * 小程序活动弹窗删除
     * @param request
     * @return
     */
    @PostMapping("/activity-popup/delete")
    public QResult list(@Validated @RequestBody ActivityPopupDeleteDTO request) {
        return QResult.success(activityPopupAdminService.delete(request));
    }
}
